arm/p2m: remove the page from p2m->pages list before freeing it
authorJulien Grall <julien.grall@arm.com>
Fri, 24 Feb 2017 09:01:59 +0000 (10:01 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 24 Feb 2017 09:01:59 +0000 (10:01 +0100)
commit9967251965a4cea19e6f69f7c5472174c4c5b971
treede1a3727f39e0bd93fc483b6ee673d845fb50d17
parent34305da2df62c67a559c20d22bdd25b549bfd1d8
arm/p2m: remove the page from p2m->pages list before freeing it

The p2m code is using the page list field to link all the pages used
for the stage-2 page tables. The page is added into the p2m->pages
list just after the allocation but never removed from the list.

The page list field is also used by the allocator, not removing may
result a later Xen crash due to inconsistency (see [1]).

This bug was introduced by the reworking of p2m code in commit 2ef3e36ec7
"xen/arm: p2m: Introduce p2m_set_entry and __p2m_set_entry".

[1] https://lists.xenproject.org/archives/html/xen-devel/2017-02/msg00524.html

Reported-by: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
master commit: cf5e1a74b9687be3d146e59ab10c26be6da9d0d4
master date: 2017-02-24 09:58:50 +0100
xen/arch/arm/p2m.c